/*
 * Copyright (c) 2017. All  rights reserved.
 * 项目名：microservice-common
 * 文件名：SysTreeviewMP.java
 * Date  ：17-11-29 下午2:53
 * Author：abin
 *
 */

package com.microservice.base.mapper.hikcommon;

import com.microservice.base.dto.SysDepartmentDto;
import com.microservice.base.entity.SysTreeview;
import com.microservice.base.mapper.BaseMP;
import com.microservice.base.vo.searchVo.SysTreeviewSearchVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 通用树
 *
 * @author abin
 * @email chcbup@163.com
 * @date 2017-09-26 12:06:23
 */
public interface SysTreeviewMP extends BaseMP<SysTreeview> {
  List<Map<String, Object>> queryBySchoolCodeAndTvParentId(
      @Param("schoolCode") String schoolCode,
      @Param("tvParentid") String tvParentid,
      @Param("tvType") String tvType);

  List<Map<String, Object>> queryAllTeacherBySchoolCode(String schoolCode);

  List<Map<String, Object>> queryAllCodeAndContentByLimit(
      @Param("schoolCode") String schoolCode, @Param("type") String type);

  List<String> querySons(String id);

  List<SysTreeview> getAllSysTree(
      @Param("schoolCode") String schoolCode,
      @Param("tvType") String tvType,
      @Param("tvItemType") String tvItemType);

  SysTreeview getRootTreeViewForType(
      @Param("schoolCode") String schoolCode, @Param("tvType") String tvType);

  Integer getTheTreeMaxSort(
      @Param("schoolCode") String schoolCode,
      @Param("tvParentid") String tvParentid,
      @Param("tvType") String tvType);

  Integer getCountForTreeviewName(
      @Param("tvName") String tvName, @Param("tvParentid") String tvParentid);

  List<SysTreeview> queryGread(
      @Param("schoolCode") String schoolCode,
      @Param("tvType") String tvType,
      @Param("selectType") String selectType);

  List<SysTreeview> queryClassNoDevice(Map<String, Object> map);

  List<Map<String, String>> queryClass(SysTreeviewSearchVo searchVo);

  List<SysTreeview> getByNameAndParentId(
      @Param("itemName") String itemName, @Param("tvParentid") String tvParentid);

  SysDepartmentDto getDepartemntInfomation(String id);

  List<SysTreeview> getAllIdsByTreeType(String s);

  List<SysTreeview> getGradeByName(
      @Param("schoolCode") String schoolCode, @Param("itemType") String itemType);

  SysTreeview getClassByName(
      @Param("schoolCode") String schoolCode,
      @Param("itemName") String itemName,
      @Param("itemType") String itemType,
      @Param("tvParentid") String tvParentid);

  @Override
  void save(SysTreeview sysTreeview);

  @Override
  int update(SysTreeview sysTreeview);

  @Override
  void delete(String id);

  List<SysTreeview> queryTreeviews(
      @Param("schoolCode") String schoolCode,
      @Param("tvType") String tvType,
      @Param("itemType") String itemType);

  SysTreeview getByItemCodeAndType(
      @Param("itemCode") String itemCode,
      @Param("tvType") String tvType,
      @Param("schoolCode") String schoolCode);

  List<SysTreeview> queryGradeTree(String schoolCode);

  List<SysTreeview> queryAllByTvParentId(SysTreeviewSearchVo sysTreeviewSearchVo);

  void replace(SysTreeview treeview);

  @Override
  List<SysTreeview> queryAll();
}
